import socket

def Main():
	host = '127.0.0.1'
	port = 50007

	sock = socket.socket()
	sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
	sock.connect((host, port))

	msg = "input data"
	while msg != 'q':
		msg = raw_input("->")
		print("Send :" + str(msg))
		sock.send(msg)
		msg = sock.recv(1024)
		print("Recv :" + str(msg))

	sock.close()


#if __name__ == '__name__':
Main()
